package com.skyeyemonitoring.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.skyeyemonitoring.R;
import com.skyeyemonitoring.base.BaseActivity;

/**
 * Created by ${QQZ} on 2017/5/10.
 */

public class LoginActivity extends BaseActivity implements View.OnClickListener {


    /**
     * 用户名
     */
    private EditText mEtLoginUser;
    /**
     * 密码
     */
    private EditText mEtLoginPassword;
    /**
     * 登录
     */
    private Button mBtnLoginConmit;

    /**
     *  跳转标记
     */
    String goToTag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.qqz_login_aty);
        setBackBtn("登录");
        initView();

        Bundle extras = getIntent().getExtras();
        goToTag = extras.getString("goToTag");
//        Toast.makeText(this, goToTag, Toast.LENGTH_SHORT).show();
    }


    private void initView() {
        mEtLoginUser = (EditText) findViewById(R.id.et_login_user);
        mEtLoginPassword = (EditText) findViewById(R.id.et_login_password);
        mBtnLoginConmit = (Button) findViewById(R.id.btn_login_conmit);
        mBtnLoginConmit.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_login_conmit:
                if (goToTag .equals("remote")) {
                    //远程帐号登录
                    startActivity(new Intent(this,RemoteActivity.class));

                }else{
                    //本地帐号登录
                    //登录本地服务器
                    //进入本地功能模块
                    startActivity(new Intent(this,LocalActivity.class));
                }
                break;
        }
    }
}
